import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'

Vue.config.productionTip = false

// 1. 全局的公共CSS
import "@/styles/index.scss";

// 2. 引入淘宝适配  
import "lib-flexible"

// 3. 引入 vant 
import Vant ,  { Lazyload ,ImagePreview  } from "vant"
import 'vant/lib/index.css';   // vant UI 组件库的CSS 
Vue.use(Vant)
Vue.use(Lazyload);
Vue.use(ImagePreview); 
// 注册时可以配置额外的选项
Vue.use(Lazyload, {
  lazyComponent: true,
});
// 4. 全局的混入
import "@/utils/mixins"

// 5. 全局的过滤器和指令
import "@/utils/golbal"

// 6. 全局的 axios 
// import axios from "axios"
import {axios} from "@/api/request"
Vue.prototype.$axios = axios;

// 7. 全局的组件
import "@/components"

// 8. 挂载 ajax axios的封装
import {ajax} from "@/api"
Vue.prototype.$ajax = ajax;

import moment from "moment"
moment.locale();    

// 9. 全局的正则 
import {reg} from "@/utils/validate"
Vue.prototype.$reg = reg;



new Vue({
  router,  // this.$router  =  router
  store,   // this.$store 
  watch:{
    '$route':function(to,from){
      // console.log(to)
    }
  },
  mounted(){
    console.log(window.devicePixelRatio)
  },
  render: h => h(App)
}).$mount('#app')
